class Stack {
  constructor() {
    this.arr = [];
  }

  isEmpty() {
    return this.arr === 0;
  }

  getSize() {
    return this.arr.length;
  }

  push(data) {
    this.arr.push(data);
  }

  pop() {
    if (this.isEmpty) {
      return -1;
    }
    return this.arr[this.arr.length - 1];
  }

  peek() {
    return this.arr.length - 1;
  }
}

// 1 有效括号匹配的问题解决-栈数据结构解决
